
Public Sub Test_isOpened()
    Dim path As String
    path = "C:\Users\liujinsuo\Desktop\others\my-master\xx\exceltemplate\xlaboot.xla"
    path = "vbaboot.xlsm"
    Dim result As Boolean
    result = UtilsWorkbook.isOpened(path)
    Debug.Print result
End Sub

Public Sub Test_getOpenedWb()
    Dim path As String
    'path = "C:\Users\liujinsuo\Desktop\others\my-master\xx\exceltemplate\xlaboot.xla"
    path = "vbaboot.xlsm"
    Dim result As Workbook
    
    Set result = UtilsWorkbook.getOpenedWb(path)
    
    If result Is Nothing Then
        Debug.Print "is Nothing"
    Else
        Debug.Print "is not Nothing"
    End If
End Sub

Public Sub Test_getWbByPath()
    Dim path As String
    'path = "C:\Users\liujinsuo\Desktop\others\my-master\xx\exceltemplate\V‹K Microsoft Office Excel ƒ[ƒNƒV[ƒg.xlsx"
    path = "vbaboot.xlsm"
    Dim result As Workbook
    
    Set result = UtilsWorkbook.getWbByPath(path)
    
    If result Is Nothing Then
        Debug.Print "is Nothing"
    Else
        Debug.Print "is not Nothing"
        result.Close
    End If
    
End Sub


Public Sub Test_getWb()
    Dim path As String
    'path = "C:\Users\liujinsuo\Desktop\others\my-master\xx\exceltemplate\V‹K Microsoft Office Excel ƒ[ƒNƒV[ƒg.xlsx"
    'path = "vbaboot.xlsm"
    path = "vbaboot.xls"
    Dim result As Workbook
    
    Set result = UtilsWorkbook.getWb(path)
    
    If result Is Nothing Then
        Debug.Print "is Nothing"
    Else
        Debug.Print "is not Nothing"
    End If
End Sub


Public Sub Test_activateWb()
    Dim path As String
    'path = "vbaboot.xlsm"
    path = "aaa.xlsx"
    
    Dim result As Workbook
    
    Set result = UtilsWorkbook.getWb(path)
    
    UtilsWorkbook.activateWb result
End Sub

Public Sub Test_closeWbByPath()
    Dim path As String
    'path = "vbaboot.xlsm"
    path = "aaa.xlsx"
    
    Dim result As Workbook
    
    Set result = UtilsWorkbook.getWb(path)
    
    UtilsWorkbook.closeWbByPath path
End Sub

Public Sub Test_hasSheet()
    Dim result As Boolean
    
    result = UtilsWorkbook.hasSheet(ThisWorkbook, "Sheet1")
    Debug.Print result = True
    
    result = UtilsWorkbook.hasSheet(ThisWorkbook, "She")
    Debug.Print result = False
    
    result = UtilsWorkbook.hasSheet(ThisWorkbook, "")
    Debug.Print result = False
End Sub

Public Sub Test_addLastSheet()
    Dim result As Worksheet
    
    Set result = UtilsWorkbook.addLastSheet(ThisWorkbook, "SheetXXX")
End Sub

Public Sub Test_deleteSheet()
    UtilsWorkbook.deleteSheet ThisWorkbook, "Sheet2"
End Sub
